<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'category',title = ${'分类' + ': ' + category.spec.displayName + ' | ' + site.title}, head = ~{::head})}">
<th:block th:fragment="head">
    <th:block th:replace="~{modules/common/open-graph :: open-graph(_title = '分类',
                _permalink = ${category.status.permalink},
                _cover = ${category.spec.cover},
                _excerpt = ${category.spec.description},
                _type = 'website')}"></th:block>
</th:block>
<th:block th:fragment="content">

    <div class="page" id="body-wrap">
        <header class="not-top-img" id="page-header">
            <nav th:replace="~{modules/nav :: nav(title = ${'分类' + ': ' + category.spec.displayName})}"></nav>
        </header>
        <main class="layout" id="content-inner" th:classappend="${theme.config.sidebar.location}">
            <div class="content-area">
                <div class="recent-posts" id="recent-posts">
                    <!-- 分类导航栏 -->
                    <div id="category-bar">
                        <div class="category-bar-items" id="category-bar-items">
                            <div class="category-bar-item" id="category-bar-home">
                                <a href="/">首页</a>
                            </div>
                            <div class="category-bar-item"
                                 th:classappend="${category.metadata.name == categoryItem.metadata.name} ? ' select'"
                                 th:each="categoryItem : ${categoryFinder.listAll()}"
                                 th:id="${categoryItem.spec.slug}">
                                <a th:href="@{${categoryItem.status.permalink}}"
                                   th:text="${categoryItem.spec.displayName}"></a>
                            </div>
                        </div>
                        <!-- 跳转到分类页 -->
                        <a class="category-bar-more" href="/categories">更多</a>
                    </div>
                </div>
                
                <!-- 文章列表 -->
                <div class="article-list-container">
                    <th:block th:replace="~{modules/post-list}"/>
                </div>
            </div>
            
            <!-- sidebar -->
            <div th:replace="~{modules/aside :: aside(${theme.config.sidebar.widgetss.categoryWidget})}"></div>
        </main>

        <!-- 底部 -->
        <footer th:replace="~{modules/footer}"/>
    </div>

</th:block>

</html>